using System;
using System.Collections.Generic;
using System.Text;
using MacomberMap.Common.Components;
using MacomberMap.Common.Database_Interface.CIM.Components;

namespace MacomberMap.Common.Database_Interface.CIM.CIM_Interface
{
    /// <summary>
    /// This class is responsible for defining the breaker-to-breaker range
    /// around an element
    /// </summary>
    public class CIM_Tracer
    {
        /// <summary>
        /// Recursively go around a base element in order to build a breaker-to-breaker topology
        /// </summary>
        /// <param name="PlusOne"></param>
        /// <param name="BaseElement"></param>
        /// <param name="StopNormalOpen">Whether to stop at normally open equipment</param>
        /// <param name="Attribute">The attribute (if any) to check </param>
        public static Dictionary<CIM_Element, CIM_TraceList> Tracer(CIM_Element BaseElement, bool PlusOne, bool StopNormalOpen, String Attribute)
        {
            //Add in our base element
            Dictionary<CIM_Element, CIM_TraceList> TraceLevels = new Dictionary<CIM_Element, CIM_TraceList>();
            CIM_TraceList BaseList = new CIM_TraceList(BaseElement);
            TraceLevels.Add(BaseElement, BaseList);

            //Parse the children of the base element recursively
            BaseList.ParseForwardLinks(TraceLevels, PlusOne,StopNormalOpen, Attribute);
            return TraceLevels;
        }

    }
}